package com.xian.im.common.enums;

import lombok.Getter;

/**
 * @program: xian-code
 * @description:  唯一ID 生成类型
 * @author: liru.xian
 * @create: 2021-01-21 20:20
 **/
@Getter
public enum UniqueTypeGenerateEnums {
    /**
     *
     */
    xim_USER("UZ"),
    xim_GROUP("GZ"),
    xim_ORG("OZ"),
    xim_MSG("MZ");

    private String code;
    UniqueTypeGenerateEnums(String code){
        this.code = code;
    }


    /**
     *
     * @param account
     * @return
     */
    public static UniqueTypeGenerateEnums startsWith(String account){
        for (UniqueTypeGenerateEnums value : UniqueTypeGenerateEnums.values()) {
            if(account.startsWith(value.getCode())){
                return value;
            }
        }
        return null;
    }
}
